import { createI18n } from 'vue-i18n'
import zh from './zh.js'
const message = {
	en: {
		msg: {
			title: "test1",
			
		}
	},
	zh: {
		...zh
	}
}

const getCurrentlaunguage = () => {
	const UAlang = navigator.language
	console.log(UAlang);
	const language = UAlang.indexOf('zh') !== -1 ? 'zh' : 'en'
	localStorage.setItem('language', language)
	return language
}

const i18n = createI18n({
	locale: getCurrentlaunguage() || 'zh',
	blobalInjection:true,
	// allowComposition: true, // you need to specify that!
	messages: message
  })

export default i18n